<?php
	$css_list[0]['url'] = './tpl/css/setting.css';
	$js_list[0] = './public/js/city.js';
?>
<!--{template inc/header_n}-->
<div id="body" class="fm960">
	<div class="piece1">
		<div class="piece1_hd"></div>
		<div class="piece1_bd clearfix">
			<div style="width:1180px;">
				<!--{template inc/settings/settings_menu}-->
				<div id="setting_box" class="fl" style="width:700px;">
					<div id="setting_form" class="setting_basic">
					    <table width="100%" border="0" cellspacing="1" class="table_list">
					    {loop $order_list $v}
                            <tr>
                                <td>{$users[$v['userid']]}</td>
                                <td>{$v['orderid']}</td>
                                <td width="210"><a href="/article.php?action=show&id={$v['artid']}">{$v['ordername']}</a></td>
                                <td id="fee_{$v['id']}">{$v['total_fee']}</td>
                                <td><?php echo date('Y-m-d',$v['dateline']); ?></td>
                                <td>
                                    {if $v['flag'] == 0}
                                    待上传合同
                                    {elseif $v['flag'] == 1}
                                    合同待签署
                                    {elseif $v['flag'] == 2}
                                    合同已签
                                    {elseif $v['flag'] == 3}
                                    已收30%预付款
                                    {elseif $v['flag'] == 4}
                                    已收80%预付款
                                    {elseif $v['flag'] == 5}
                                    已付全款
                                    {/if} 
                                </td>
                                <td
                                    <p style="margin-bottom:5px;"><a href="/shareinfo.php?action=orderdetailpc&id={$v['id']}">订单明细</a></p>
                                    {if $v['flag'] == 0 || $v['flag'] == 1}
                                	<input id="o_{$v['id']}" type="text" size="5" value="{$v['total_fee']}"/>
                                	<p style="padding-top:3px;">
                                	    <input onclick="fixprice({$v['id']})" type="button" class="green_button" value="改价格">
                                	</p>
                                	{elseif $v['flag'] == 2}
                                    <a href="javascript:;" onclick="getqrcode({$v['id']}, '预付款<?php echo $v['total_fee']*0.3 ?>')">收预付款</a>
                                	{elseif $v['flag'] == 3}
                                    <a href="javascript:;" onclick="getqrcode({$v['id']}, '中期款<?php echo $v['total_fee']*0.5 ?>')">收中期款</a>
                                	{elseif $v['flag'] == 4}
                                    <a href="javascript:;" onclick="getqrcode({$v['id']}, '尾款<?php echo $v['total_fee']*0.2 ?>')">收尾款</a>
                                	{elseif $v['flag'] == 5}
                                    <a href="javascript:;">-</a>
                                	{/if}
                                </td>
                            </tr>
					    {/loop}
					    </table>
                        <div class="pagination mt20"> 				
                        	<!--{subtemplate inc/pages}--> 
                        </div>
					</div>
				</div>
			</div>
		</div>
		<div class="piece1_ft"></div>
	</div>
	
    <div class="i_notice2">
        <div class="j_title">公告栏</div>
        <div class="j_list">
            <ul>
                <li><a href="#"><span style="color:red;">泡泡火锅加盟,提供个大卫视广告宣传</span></a></li>
                <li><a href="#">火锅怎么做才好吃?</a></li>
                <li><a href="#">谁能给我一份火锅配菜全谱?</a></li>
                <li><a href="#">火锅一般而言,是以锅为器具</a></li>
                <li><a href="#">泡泡火锅加盟,提供个大卫视广告宣传</a></li>
                <li><a href="#">火锅怎么做才好吃?</a></li>
                <li><a href="#">谁能给我一份火锅配菜全谱?</a></li>
                <li><a href="#">火锅一般而言,是以锅为器具</a></li>
            </ul>
        </div>
    </div>
</div>
<script src="/public/v1/js/layer/layer.js"></script>
<script type="text/javascript">
function fixprice(id) {
    var newp = $('#o_'+id).val();
    if(!/^[0-9\.]+$/i.test(newp)) {
        alert('请输入正确的价格！');
        return;
    }
    
    $.get('/shareinfo.php?action=sorder&op=fixprice&id='+id+'&newp='+newp, function(s) {
        if(s == '1') {
            $('#fee_'+id).html(newp);
            alert('修改成功！');
        }
    })
}

function agree(id, obj) {
    $.get('/shareinfo.php?action=sorder&op=dounpay&id='+id, function(s) {
        if(s == '1') {
            alert('修改成功！');
        }
        
        $(obj).remove();
    });
}

function getqrcode(id, money) {
    layer.open({
        type: 1,
        title: false,
        closeBtn: 0,
        shadeClose: true,
        area: ['257px', '300px'],
        content: '<div style="text-align:center;"><img src="/misc.php?action=qrcode&orderid='+id + '" style="height:257px;"/><h5 style="color:red;">请使用支付宝扫码支付('+money+'元)</h5><p>支付成功后<a href="">点击此处</a></p></div>'
    });
}
</script>
<!--{template inc/footer}-->